const mysql = require('mysql');
const pool = mysql.createPool({
    host: '127.0.0.1',
    port: 3306,
    user: 'root',
    password: '',
    database: 'rrbm'
})
function sql(sql, arry) {
    return new Promise((resolve, reject) => {
        pool.query(sql, arry, (err, result) => {
            if (err) {
                reject(err)
                console.warn("sql在执行时出现了错误哦")
                return
            }
            resolve(result)
        })
    })
}
module.exports = { pool, sql };